<?php

use yii\helpers\Html;
use yii\widgets\DetailView;


$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Products'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="product-view">

    <h2 class="page-header"><?= Html::encode($this->title) ?>
        <p class="pull-right"> 
            <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
            <?= Html::a(Yii::t('app.cruise', 'Trip'), ['trip', 'id' => $model->id], ['class' => 'btn btn-warning']) ?>
            <?= Html::a(Yii::t('app', 'Index'), ['index'], ['class' => 'btn btn-danger']) ?>
        </p>
    </h2>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'cruise.name',
            'code',
            'go_time:date',
            'return_time:date',
            'day',
            [
                'attribute' => 'from_city',
                'value' => isset(Yii::$app->params['city'][$model->from_city]) ? Yii::$app->params['city'][$model->from_city] : '(未设置)',
            ],
            [
                'attribute' => 'to_city',
                'value' => isset(Yii::$app->params['city'][$model->to_city]) ? Yii::$app->params['city'][$model->to_city] : '(未设置)',
            ],
            [
                'attribute' => 'go_city',
                'value' => isset(Yii::$app->params['city'][$model->go_city]) ? Yii::$app->params['city'][$model->go_city] : '(未设置)',
            ],
            [
                'attribute' => 'return_city',
                'value' => isset(Yii::$app->params['city'][$model->return_city]) ? Yii::$app->params['city'][$model->return_city] : '(未设置)',
            ],
            'name',
            [
                'attribute' => 'line',
                'value' => Yii::$app->params['line'][$model->line],
            ],
            [
                'attribute' => 'stock',
                'value' => Yii::$app->params['product_stock'][$model->stock],
            ],
            'cost:html',
            'nocost:html',
            'cancel:html',
            'discount:html',
            'signup:html',
            'land:html',
            'expense:html',
            'visa:html',
            'sale:html',
            [
                'attribute' => 'status',
                'value' => Yii::$app->params['status'][$model->status],
            ],
            //'user_id',
            'created_at:date',
            'updated_at:relativeTime',
        ],
    ]) ?>

</div>
